<template>
  <div>
    <div v-for="item in menus">
      <div v-if="item.isParent">
        <el-submenu :index="item.path">
          <template slot="title">
            <i v-show="item.icon!==''" :class="item.icon"></i>
            <span> {{item.label}}</span>
          </template>
          <MenuBar :menus="item.children"></MenuBar>
        </el-submenu>
      </div>
      <div v-else>
        <el-menu-item :index="item.path">
          <i v-show="item.icon!==''" :class="item.icon"></i>
          <span> {{item.label}}</span>
        </el-menu-item>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "MenuBar",
    props: ['menus']
  }
</script>

<style scoped>

</style>
